package org.jeecg.modules.online.desform.constant;

import org.apache.commons.lang.StringUtils;

public enum PermissionTypeEnum {

    DATA("data", "数据权限"),
    BUTTON("button", "按钮权限"),
    FIELD("field", "字段权限");

    private String value;

    private String message;

    PermissionTypeEnum(String value, String message) {
        this.value = value;
        this.message = message;
    }

    public String getValue() {
        return value;
    }

    public String getMessage() {
        return message;
    }

    public static PermissionTypeEnum getByValue(String value) {
        if (StringUtils.isBlank(value)) {
            return null;
        }
        for (PermissionTypeEnum item : values()) {
            if (item.getValue().equalsIgnoreCase(value)) {
                return item;
            }
        }
        return null;
    }

}
